package controller;

import service.AtmService;
import util.MySpring;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Deposit1 extends HttpServlet {
    private AtmService service = MySpring.getBean("service.AtmService");
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String name = request.getParameter("name7");
        String depositBalance = request.getParameter("balance3");
        service.deposit(name,new Float(depositBalance));
        request.setAttribute("name", name);
        request.getRequestDispatcher("wel.jsp").forward(request,response);
    }
}
